//
// Delaunay Triangulation
//
// Homework of CG lesson (Fall 2009) in Tsinghua University.
// All rights reserved.
//

#pragma once

#include "vector2d.h"

/**
 * class for 2d point.
 */
class Point2d
{
// public constructors & destructor
public:
    /**
     * Sets all coordinate values to 0.0 by default.
     */
    Point2d(void);
    /**
     * Sets x, y coordinate values with @c tx and @c ty.
     */
    Point2d(double tx, double ty);
    /**
     * Copy constructor.
     */
    Point2d(const Point2d& p);

// public member functions
public:
    /**
     * Operator + for @c v.
     */
    Point2d operator+(const Vector2d& v) const;
    /**
     * Operator - for @c p.
     */
    Vector2d operator-(const Point2d& p) const;
    /**
     * Operator ==.
     */
    bool operator==(const Point2d& p) const;
	/**
	 * Operator <
	 */
	bool operator<(const Point2d& p) const;

// public data members
public:
    double x;
    double y;
	double z;
};
